package com.songyang.blog.util;

import java.util.Random;

public class RandomStringUtils {
    public static String getRandomString() {
        Random random = new Random();
//        int length=random.nextInt(10)+10;
        int length=16;
        StringBuffer buffer = new StringBuffer("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
        StringBuffer sb = new StringBuffer();

        int range = buffer.length();
        for (int i = 0; i < length; i++) {
            sb.append(buffer.charAt(random.nextInt(range)));
        }
        return sb.toString();
    }
}
